package com.hzpd.hainan.app;

import android.app.Activity;
import android.content.Intent;

import com.hzpd.hainan.model.news.NewsBean;
import com.hzpd.hainan.module.news.activity.NewsAlbumActivity;
import com.hzpd.hainan.module.news.activity.NewsHtmlDetailActivity;
import com.hzpd.hainan.module.news.activity.NewsZhuanTiActivity;
import com.hzpd.hainan.utils.AAnim;
import com.hzpd.hainan.utils.LogUtils;

/**
 * Created by 猪猪侠 on 2017/7/4.
 */

public class MyActivitymanager {
    //test
    public static void pushActivity(Activity context, NewsBean newsBean, String tid, String from) {
        Intent mIntent = new Intent();
        mIntent.putExtra("newbean", newsBean);
        mIntent.putExtra("tid", tid);
        mIntent.putExtra("from", from);
        LogUtils.e("rtype-->" + newsBean.getRtype());
        // 1新闻 2图集 3直播 4专题 5关联新闻 6视频
        if ("1".equals(newsBean.getRtype())) {
            mIntent.setClass(context, NewsHtmlDetailActivity.class);
        } else if ("2".equals(newsBean.getRtype())) {
            mIntent.setClass(context, NewsAlbumActivity.class);
        }
        else if ("4".equals(newsBean.getRtype())) {
            mIntent.setClass(context, NewsZhuanTiActivity.class);


        } else {
            mIntent.setClass(context, NewsHtmlDetailActivity.class);
        }
        context.startActivityForResult(mIntent, 0);
        AAnim.ActivityStartAnimation(context);
    }
}
